#ifndef _CHILDFRAME_H
#define _CHILDFRAME_H

#include <wx/wx.h>
#include <wx/toolbar.h>
#include <wx/treectrl.h>
#include <wx/aui/tabmdi.h>

#define GPW() ((MFrame*)GetParent())

//===========================================================//
//CFrame(Child frame)
//===========================================================//
class CFrame : public wxPanel
{
	void * m_parent;
	bool m_HasToolBar;
	wxToolBar * m_ToolBar;
public:
	CFrame();
	CFrame(wxWindow * parent,
			wxWindowID id = wxID_ANY,
			bool has_toolbar = true);
	
	virtual void InitControls();

	virtual bool Create(wxWindow * parent,
						wxWindowID id = wxID_ANY,
						bool has_toolbar = true);
	
	virtual wxToolBar* CreateToolBar(long style,
                                     wxWindowID winid);
	virtual wxToolBar *GetToolBar() const;
	virtual void CreateControls();
	void * GetParent();
private :
	virtual void OnToolButton(wxCommandEvent & event);
public:
	virtual void OnActivated(wxActivateEvent & event);
private:
	virtual void OnExit(wxEvent& WXUNUSED(event));
	virtual void OnPaint(wxPaintEvent &event);
	DECLARE_EVENT_TABLE()
};

//===========================================================//
//AUI_CFrame(Child frame) with AUI styles
//===========================================================//

class AUI_CFrame : public CFrame
{
	wxAuiManager * m_FrameManager;
	wxPanel * panel;
public:
	wxPanel * GetPanel();
	wxAuiManager * GetFManager();
public:
	~AUI_CFrame();
	bool Create(wxWindow * parent,
				wxWindowID id,
				bool has_toolbar);
	virtual void CreateControls();
private:
	void OnPaint(wxPaintEvent &event);
	DECLARE_EVENT_TABLE()
};


#endif
